package com.ldb.Controller.service;

import java.util.List;

import com.ldb.Controller.dao.ActivityDao;
import com.ldb.Controller.entity.Activity;
import com.ldb.Controller.entity.Messages;

public class ActivityManager {
	
	private ActivityDao activityDao;

	public ActivityDao getActivityDao() {
		return activityDao;
	}

	public void setActivityDao(ActivityDao activityDao) {
		this.activityDao = activityDao;
	}
	
	public void addActivity(Activity activity) {
		this.activityDao.addEntity(activity);
	}
	
	public void deleteActivity(String id) {
		this.activityDao.deleteEntity(Activity.class, id);
	}
	
	public Activity getActivityById(String id) {
		return this.activityDao.getEntity("activity_id", id,Activity.class);
	}
	
	public void updateActivity(String activity_id,Activity activity) {
		this.activityDao.updateEntity(activity_id, activity);
	}
	
	public List<Activity> getActivityByTitle(String title){
		this.activityDao.setClazz(Activity.class);
		return this.activityDao.getEntityListNotSure("title", title);
	}
	
	public List<Activity> getActivityAll(){
		activityDao.setClazz(Activity.class);
		return this.activityDao.getEntityAll();
	}
	
	public List<Activity> getActivityDesc(){
		activityDao.setClazz(Activity.class);
		return this.activityDao.getEntityAllDesc();
	}

}
